[MERGED] osmo-iuh[master]: vty typo: 'show hnb': SCTP stream, not SCCP stream

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty typo: 'show hnb': SCTP stream, not SCCP stream
..


vty typo: 'show hnb': SCTP stream, not SCCP stream

Change-Id: Iceb29af9f4ef6b4b4ed9778bdd683d30c201371d
---
M src/hnbgw_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index d41e3c0..060319b 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -181,7 +181,7 @@
vty_out(vty, "HNB ");
vty_out_ofd_addr(vty, hnb->conn? osmo_stream_srv_get_ofd(hnb->conn) : 
NULL);
vty_out(vty, " \"%s\"%s", hnb->identity_info, VTY_NEWLINE);
-   vty_out(vty, "MCC %u MNC %u LAC %u RAC %u SAC %u CID %u 
SCCP-stream:HNBAP=%u,RUA=%u%s",
+   vty_out(vty, "MCC %u MNC %u LAC %u RAC %u SAC %u CID %u 
SCTP-stream:HNBAP=%u,RUA=%u%s",
hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, 
hnb->id.sac, hnb->id.cid,
hnb->hnbap_stream, hnb->rua_stream, VTY_NEWLINE);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iceb29af9f4ef6b4b4ed9778bdd683d30c201371d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-iuh[master]: vty typo: 'show hnb': SCTP stream, not SCCP stream

2017-12-25 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iceb29af9f4ef6b4b4ed9778bdd683d30c201371d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


Build failure of network:osmocom:nightly/osmo-iuh in Debian_9.0/armv7l

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/Debian_9.0/armv7l

Package network:osmocom:nightly/osmo-iuh failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  791s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  791s] make[5]: *** [hnbgw_vty.o] Error 1
[  791s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  791s] Makefile:639: recipe for target 'all-recursive' failed
[  791s] make[4]: *** [all-recursive] Error 1
[  791s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  791s] Makefile:451: recipe for target 'all' failed
[  791s] make[3]: *** [all] Error 2
[  791s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  791s] Makefile:452: recipe for target 'all-recursive' failed
[  791s] make[2]: *** [all-recursive] Error 1
[  791s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  791s] Makefile:376: recipe for target 'all' failed
[  791s] make[1]: *** [all] Error 2
[  791s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  791s] dh_auto_build: make -j1 returned exit code 2
[  791s] debian/rules:9: recipe for target 'build' failed
[  791s] make: *** [build] Error 2
[  791s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  791s] 
[  791s] armbuild26 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:30:00 UTC 2017.
[  791s] 
[  791s] ### VM INTERACTION START ###
[  794s] [  779.794601] SysRq : Power Off
[  794s] [  779.802517] reboot: Power down
[  794s] ### VM INTERACTION END ###
[  794s] 
[  794s] armbuild26 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:30:03 UTC 2017.
[  794s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in Debian_9.0/aarch64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/Debian_9.0/aarch64

Package network:osmocom:nightly/osmo-iuh failed to build in Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[ 1058s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[ 1058s] make[5]: *** [hnbgw_vty.o] Error 1
[ 1058s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[ 1058s] Makefile:639: recipe for target 'all-recursive' failed
[ 1058s] make[4]: *** [all-recursive] Error 1
[ 1058s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[ 1058s] Makefile:451: recipe for target 'all' failed
[ 1058s] make[3]: *** [all] Error 2
[ 1058s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[ 1058s] Makefile:452: recipe for target 'all-recursive' failed
[ 1058s] make[2]: *** [all-recursive] Error 1
[ 1058s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[ 1058s] Makefile:376: recipe for target 'all' failed
[ 1058s] make[1]: *** [all] Error 2
[ 1058s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[ 1058s] dh_auto_build: make -j1 returned exit code 2
[ 1058s] debian/rules:9: recipe for target 'build' failed
[ 1058s] make: *** [build] Error 2
[ 1058s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[ 1058s] 
[ 1058s] obs-arm-1 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:24:01 UTC 2017.
[ 1058s] 
[ 1058s] ### VM INTERACTION START ###
[ 1061s] [ 1039.726650] sysrq: SysRq : Power Off
[ 1061s] [ 1039.729617] reboot: Power down
[ 1061s] ### VM INTERACTION END ###
[ 1061s] 
[ 1061s] obs-arm-1 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:24:04 UTC 2017.
[ 1061s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_17.04/i586

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_17.04/i586

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_17.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  618s] cc1: some warnings being treated as errors
[  618s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  618s] make[5]: *** [hnbgw_vty.o] Error 1
[  618s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  618s] Makefile:639: recipe for target 'all-recursive' failed
[  618s] make[4]: *** [all-recursive] Error 1
[  618s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  618s] Makefile:451: recipe for target 'all' failed
[  618s] make[3]: *** [all] Error 2
[  618s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  618s] Makefile:452: recipe for target 'all-recursive' failed
[  618s] make[2]: *** [all-recursive] Error 1
[  618s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  618s] Makefile:376: recipe for target 'all' failed
[  618s] make[1]: *** [all] Error 2
[  618s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  618s] dh_auto_build: make -j1 returned exit code 2
[  618s] debian/rules:9: recipe for target 'build' failed
[  618s] make: *** [build] Error 2
[  618s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  618s] 
[  618s] lamb60 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:54 UTC 2017.
[  618s] 
[  618s] ### VM INTERACTION START ###
[  621s] [  612.803808] reboot: Power down
[  621s] ### VM INTERACTION END ###
[  621s] 
[  621s] lamb60 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:57 UTC 2017.
[  621s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_16.04/i586

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_16.04/i586

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_16.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  585s] cc1: some warnings being treated as errors
[  585s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  585s] make[5]: *** [hnbgw_vty.o] Error 1
[  585s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  585s] Makefile:639: recipe for target 'all-recursive' failed
[  585s] make[4]: *** [all-recursive] Error 1
[  585s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  585s] Makefile:451: recipe for target 'all' failed
[  585s] make[3]: *** [all] Error 2
[  585s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  585s] Makefile:452: recipe for target 'all-recursive' failed
[  585s] make[2]: *** [all-recursive] Error 1
[  585s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  585s] Makefile:376: recipe for target 'all' failed
[  585s] make[1]: *** [all] Error 2
[  585s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  585s] dh_auto_build: make -j1 returned exit code 2
[  585s] debian/rules:9: recipe for target 'build' failed
[  585s] make: *** [build] Error 2
[  585s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  585s] 
[  585s] lamb02 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:05 UTC 2017.
[  585s] 
[  585s] ### VM INTERACTION START ###
[  588s] [  580.175297] reboot: Power down
[  588s] ### VM INTERACTION END ###
[  588s] 
[  588s] lamb02 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:09 UTC 2017.
[  588s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in Debian_9.0/i586

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/Debian_9.0/i586

Package network:osmocom:nightly/osmo-iuh failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  612s] cc1: some warnings being treated as errors
[  612s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  612s] make[5]: *** [hnbgw_vty.o] Error 1
[  612s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  612s] Makefile:639: recipe for target 'all-recursive' failed
[  612s] make[4]: *** [all-recursive] Error 1
[  612s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  612s] Makefile:451: recipe for target 'all' failed
[  612s] make[3]: *** [all] Error 2
[  612s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  612s] Makefile:452: recipe for target 'all-recursive' failed
[  612s] make[2]: *** [all-recursive] Error 1
[  612s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  612s] Makefile:376: recipe for target 'all' failed
[  612s] make[1]: *** [all] Error 2
[  612s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  612s] dh_auto_build: make -j1 returned exit code 2
[  612s] debian/rules:9: recipe for target 'build' failed
[  612s] make: *** [build] Error 2
[  612s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  612s] 
[  612s] lamb61 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:05 UTC 2017.
[  612s] 
[  612s] ### VM INTERACTION START ###
[  615s] [  605.854013] reboot: Power down
[  615s] ### VM INTERACTION END ###
[  615s] 
[  615s] lamb61 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:09 UTC 2017.
[  615s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in Debian_9.0/x86_64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/Debian_9.0/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  534s] cc1: some warnings being treated as errors
[  534s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  534s] make[5]: *** [hnbgw_vty.o] Error 1
[  534s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  534s] Makefile:639: recipe for target 'all-recursive' failed
[  534s] make[4]: *** [all-recursive] Error 1
[  534s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  534s] Makefile:451: recipe for target 'all' failed
[  534s] make[3]: *** [all] Error 2
[  534s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  534s] Makefile:452: recipe for target 'all-recursive' failed
[  534s] make[2]: *** [all-recursive] Error 1
[  534s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  534s] Makefile:376: recipe for target 'all' failed
[  534s] make[1]: *** [all] Error 2
[  534s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  534s] dh_auto_build: make -j1 returned exit code 2
[  534s] debian/rules:9: recipe for target 'build' failed
[  534s] make: *** [build] Error 2
[  534s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  534s] 
[  534s] cloud118 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:11 UTC 2017.
[  534s] 
[  534s] ### VM INTERACTION START ###
[  537s] [  516.509639] reboot: Power down
[  539s] ### VM INTERACTION END ###
[  539s] 
[  539s] cloud118 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:10:17 UTC 2017.
[  539s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_16.10/x86_64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_16.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  583s] cc1: some warnings being treated as errors
[  583s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  583s] make[5]: *** [hnbgw_vty.o] Error 1
[  583s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  583s] Makefile:639: recipe for target 'all-recursive' failed
[  583s] make[4]: *** [all-recursive] Error 1
[  583s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  583s] Makefile:451: recipe for target 'all' failed
[  583s] make[3]: *** [all] Error 2
[  583s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  583s] Makefile:452: recipe for target 'all-recursive' failed
[  583s] make[2]: *** [all-recursive] Error 1
[  583s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  583s] Makefile:376: recipe for target 'all' failed
[  583s] make[1]: *** [all] Error 2
[  583s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  583s] dh_auto_build: make -j1 returned exit code 2
[  583s] debian/rules:9: recipe for target 'build' failed
[  583s] make: *** [build] Error 2
[  583s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  583s] 
[  583s] lamb56 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:09:43 UTC 2017.
[  583s] 
[  583s] ### VM INTERACTION START ###
[  586s] [  578.362871] reboot: Power down
[  586s] ### VM INTERACTION END ###
[  586s] 
[  586s] lamb56 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:09:46 UTC 2017.
[  586s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_17.10/x86_64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_17.10/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_17.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  600s] cc1: some warnings being treated as errors
[  600s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  600s] make[5]: *** [hnbgw_vty.o] Error 1
[  600s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  600s] Makefile:639: recipe for target 'all-recursive' failed
[  600s] make[4]: *** [all-recursive] Error 1
[  600s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  600s] Makefile:451: recipe for target 'all' failed
[  600s] make[3]: *** [all] Error 2
[  600s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  600s] Makefile:452: recipe for target 'all-recursive' failed
[  600s] make[2]: *** [all-recursive] Error 1
[  600s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  600s] Makefile:376: recipe for target 'all' failed
[  600s] make[1]: *** [all] Error 2
[  600s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  600s] dh_auto_build: make -j1 returned exit code 2
[  600s] debian/rules:9: recipe for target 'build' failed
[  600s] make: *** [build] Error 2
[  600s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  600s] 
[  600s] lamb24 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:09:03 UTC 2017.
[  600s] 
[  600s] ### VM INTERACTION START ###
[  603s] [  594.381672] reboot: Power down
[  603s] ### VM INTERACTION END ###
[  603s] 
[  603s] lamb24 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:09:06 UTC 2017.
[  603s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_16.10/i586

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_16.10/i586

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_16.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  526s] cc1: some warnings being treated as errors
[  526s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  526s] make[5]: *** [hnbgw_vty.o] Error 1
[  526s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  526s] Makefile:639: recipe for target 'all-recursive' failed
[  526s] make[4]: *** [all-recursive] Error 1
[  526s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  526s] Makefile:451: recipe for target 'all' failed
[  526s] make[3]: *** [all] Error 2
[  526s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  526s] Makefile:452: recipe for target 'all-recursive' failed
[  526s] make[2]: *** [all-recursive] Error 1
[  526s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  526s] Makefile:376: recipe for target 'all' failed
[  526s] make[1]: *** [all] Error 2
[  526s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  526s] dh_auto_build: make -j1 returned exit code 2
[  526s] debian/rules:9: recipe for target 'build' failed
[  526s] make: *** [build] Error 2
[  526s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  526s] 
[  526s] cloud101 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:07:54 UTC 2017.
[  526s] 
[  526s] ### VM INTERACTION START ###
[  529s] [  513.052515] reboot: Power down
[  530s] ### VM INTERACTION END ###
[  530s] 
[  530s] cloud101 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:07:58 UTC 2017.
[  530s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_16.04/x86_64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  377s] cc1: some warnings being treated as errors
[  377s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  377s] make[5]: *** [hnbgw_vty.o] Error 1
[  377s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  377s] Makefile:639: recipe for target 'all-recursive' failed
[  377s] make[4]: *** [all-recursive] Error 1
[  377s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  377s] Makefile:451: recipe for target 'all' failed
[  377s] make[3]: *** [all] Error 2
[  377s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  377s] Makefile:452: recipe for target 'all-recursive' failed
[  377s] make[2]: *** [all-recursive] Error 1
[  377s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  377s] Makefile:376: recipe for target 'all' failed
[  377s] make[1]: *** [all] Error 2
[  377s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  377s] dh_auto_build: make -j1 returned exit code 2
[  377s] debian/rules:9: recipe for target 'build' failed
[  377s] make: *** [build] Error 2
[  377s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  377s] 
[  377s] wildcard3 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:07:22 UTC 2017.
[  377s] 
[  377s] ### VM INTERACTION START ###
[  380s] [  370.373181] reboot: Power down
[  381s] ### VM INTERACTION END ###
[  381s] 
[  381s] wildcard3 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:07:27 UTC 2017.
[  381s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_17.04/x86_64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_17.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  387s] cc1: some warnings being treated as errors
[  387s] Makefile:610: recipe for target 'hnbgw_vty.o' failed
[  387s] make[5]: *** [hnbgw_vty.o] Error 1
[  387s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  387s] Makefile:639: recipe for target 'all-recursive' failed
[  387s] make[4]: *** [all-recursive] Error 1
[  387s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  387s] Makefile:451: recipe for target 'all' failed
[  387s] make[3]: *** [all] Error 2
[  387s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  387s] Makefile:452: recipe for target 'all-recursive' failed
[  387s] make[2]: *** [all-recursive] Error 1
[  387s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  387s] Makefile:376: recipe for target 'all' failed
[  387s] make[1]: *** [all] Error 2
[  387s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  387s] dh_auto_build: make -j1 returned exit code 2
[  387s] debian/rules:9: recipe for target 'build' failed
[  387s] make: *** [build] Error 2
[  387s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  387s] 
[  387s] wildcard2 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:06:19 UTC 2017.
[  387s] 
[  387s] ### VM INTERACTION START ###
[  390s] [  374.214571] reboot: Power down
[  391s] ### VM INTERACTION END ###
[  391s] 
[  391s] wildcard2 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:06:23 UTC 2017.
[  391s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in Debian_8.0/i586

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/Debian_8.0/i586

Package network:osmocom:nightly/osmo-iuh failed to build in Debian_8.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  276s] Makefile:599: recipe for target 'hnbgw_vty.o' failed
[  276s] make[5]: *** [hnbgw_vty.o] Error 1
[  276s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  276s] Makefile:628: recipe for target 'all-recursive' failed
[  276s] make[4]: *** [all-recursive] Error 1
[  276s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  276s] Makefile:439: recipe for target 'all' failed
[  276s] make[3]: *** [all] Error 2
[  276s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  276s] Makefile:440: recipe for target 'all-recursive' failed
[  276s] make[2]: *** [all-recursive] Error 1
[  276s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  276s] Makefile:363: recipe for target 'all' failed
[  276s] make[1]: *** [all] Error 2
[  276s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  276s] dh_auto_build: make -j1 returned exit code 2
[  276s] debian/rules:9: recipe for target 'build' failed
[  276s] make: *** [build] Error 2
[  276s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  276s] 
[  276s] lamb55 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:04:32 UTC 2017.
[  276s] 
[  276s] ### VM INTERACTION START ###
[  277s] Powering off.
[  277s] [  268.508556] reboot: Power down
[  277s] ### VM INTERACTION END ###
[  277s] 
[  277s] lamb55 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:04:34 UTC 2017.
[  277s] 

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


Build failure of network:osmocom:nightly/osmo-iuh in Debian_8.0/x86_64

2017-12-25 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/Debian_8.0/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in Debian_8.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  264s] Makefile:599: recipe for target 'hnbgw_vty.o' failed
[  264s] make[5]: *** [hnbgw_vty.o] Error 1
[  264s] make[5]: Leaving directory '/usr/src/packages/BUILD/src'
[  264s] Makefile:628: recipe for target 'all-recursive' failed
[  264s] make[4]: *** [all-recursive] Error 1
[  264s] make[4]: Leaving directory '/usr/src/packages/BUILD/src'
[  264s] Makefile:439: recipe for target 'all' failed
[  264s] make[3]: *** [all] Error 2
[  264s] make[3]: Leaving directory '/usr/src/packages/BUILD/src'
[  264s] Makefile:440: recipe for target 'all-recursive' failed
[  264s] make[2]: *** [all-recursive] Error 1
[  264s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  264s] Makefile:363: recipe for target 'all' failed
[  264s] make[1]: *** [all] Error 2
[  264s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  264s] dh_auto_build: make -j1 returned exit code 2
[  264s] debian/rules:9: recipe for target 'build' failed
[  264s] make: *** [build] Error 2
[  264s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  264s] 
[  264s] lamb19 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:02:11 UTC 2017.
[  264s] 
[  264s] ### VM INTERACTION START ###
[  265s] Powering off.
[  265s] [  257.632683] reboot: Power down
[  265s] ### VM INTERACTION END ###
[  265s] 
[  265s] lamb19 failed "build osmo-iuh_0.2.0.20171225.dsc" at Mon Dec 25 
20:02:13 UTC 2017.
[  265s] 

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


[PATCH] osmo-bsc[master]: abisip-find: add --interval option

2017-12-25 Thread Neels Hofmeyr

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

abisip-find: add --interval option

Change-Id: I9540054bdda185b2585209289cee565f61f33dcf
---
M src/ipaccess/abisip-find.c
1 file changed, 17 insertions(+), 3 deletions(-)


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

diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c
index d94e18a..4d3e390 100644
--- a/src/ipaccess/abisip-find.c
+++ b/src/ipaccess/abisip-find.c
@@ -39,10 +39,12 @@
 
 static struct {
const char *ifname;
+   int send_interval;
bool list_view;
time_t list_view_timeout;
 } cmdline_opts = {
.ifname = NULL,
+   .send_interval = 5,
.list_view = false,
.list_view_timeout = 10,
 };
@@ -53,6 +55,7 @@
printf("Usage: abisip-find [-l] []\n");
printf("Specify the outgoing network interface,\n"
   "e.g. 'eth0'\n");
+   printf("  -i --interval  Send broadcast frames every  
seconds.\n");
printf("  -l --list-viewInstead of printing received responses,\n"
   "output a sorted list of currently present\n"
   "base stations and change events.\n");
@@ -67,12 +70,13 @@
int option_index = 0, c;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
+   {"send-interval", 1, 0, 'i'},
{"list-view", 0, 0, 'l'},
{"timeout", 1, 0, 't'},
{0, 0, 0, 0}
};
 
-   c = getopt_long(argc, argv, "hlt:",
+   c = getopt_long(argc, argv, "hi:lt:",
long_options, _index);
if (c == -1)
break;
@@ -81,6 +85,14 @@
case 'h':
print_help();
exit(EXIT_SUCCESS);
+   case 'i':
+   errno = 0;
+   cmdline_opts.send_interval = strtoul(optarg, NULL, 10);
+   if (errno) {
+   fprintf(stderr, "Invalid interval value: %s\n", 
optarg);
+   exit(EXIT_FAILURE);
+   }
+   break;
case 't':
errno = 0;
cmdline_opts.list_view_timeout = strtoul(optarg, NULL, 
10);
@@ -363,7 +375,7 @@
 
base_stations_bump(false);
 
-   osmo_timer_schedule(, 5, 0);
+   osmo_timer_schedule(, cmdline_opts.send_interval, 0);
 }
 
 int main(int argc, char **argv)
@@ -382,6 +394,8 @@
"  network interface, e.g. ``%s eth0''\n", argv[0]);
if (!cmdline_opts.list_view)
fprintf(stdout, "- You may find the --list-view option 
convenient.\n");
+   else if (cmdline_opts.send_interval >= cmdline_opts.list_view_timeout)
+   fprintf(stdout, "\nWARNING: the --timeout should be larger than 
--interval.\n\n");
 
bfd.cb = bfd_cb;
bfd.when = BSC_FD_READ | BSC_FD_WRITE;
@@ -398,7 +412,7 @@
}
 
osmo_timer_setup(, timer_cb, );
-   osmo_timer_schedule(, 5, 0);
+   osmo_timer_schedule(, cmdline_opts.send_interval, 0);
 
printf("Trying to find ip.access BTS by broadcast UDP...\n");
 

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

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


[PATCH] osmo-bsc[master]: abisip-find: add timeout option

2017-12-25 Thread Neels Hofmeyr

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

abisip-find: add timeout option

Change-Id: I3b30e2b9cac9c70ba8d272022eee596de39d7b82
---
M src/ipaccess/abisip-find.c
1 file changed, 17 insertions(+), 2 deletions(-)


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

diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c
index cba8a7a..d94e18a 100644
--- a/src/ipaccess/abisip-find.c
+++ b/src/ipaccess/abisip-find.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -39,9 +40,11 @@
 static struct {
const char *ifname;
bool list_view;
+   time_t list_view_timeout;
 } cmdline_opts = {
.ifname = NULL,
.list_view = false,
+   .list_view_timeout = 10,
 };
 
 static void print_help()
@@ -53,6 +56,9 @@
printf("  -l --list-viewInstead of printing received responses,\n"
   "output a sorted list of currently present\n"
   "base stations and change events.\n");
+   printf("  -t --timeout   Drop base stations after  seconds of\n"
+  "receiving no more replies from it.\n"
+  "Implies --list-view.\n");
 }
 
 static void handle_options(int argc, char **argv)
@@ -62,10 +68,11 @@
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"list-view", 0, 0, 'l'},
+   {"timeout", 1, 0, 't'},
{0, 0, 0, 0}
};
 
-   c = getopt_long(argc, argv, "hl",
+   c = getopt_long(argc, argv, "hlt:",
long_options, _index);
if (c == -1)
break;
@@ -74,6 +81,14 @@
case 'h':
print_help();
exit(EXIT_SUCCESS);
+   case 't':
+   errno = 0;
+   cmdline_opts.list_view_timeout = strtoul(optarg, NULL, 
10);
+   if (errno) {
+   fprintf(stderr, "Invalid timeout value: %s\n", 
optarg);
+   exit(EXIT_FAILURE);
+   }
+   /* fall through to imply list-view: */
case 'l':
cmdline_opts.list_view = true;
break;
@@ -247,7 +262,7 @@
bool changed = false;
 
llist_for_each_entry_safe(bs, next_bs, _stations, entry) {
-   if (now - bs->timestamp < 10)
+   if (now - bs->timestamp < cmdline_opts.list_view_timeout)
continue;
print_timestamp();
printf("LOST:\n%s\n", bs->line);

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

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


[PATCH] osmo-bsc[master]: abisip-find: update copyright

2017-12-25 Thread Neels Hofmeyr

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

abisip-find: update copyright

Change-Id: Ibb72fa16cc1a8b6809d0510211bfc61a170d1250
---
M src/ipaccess/abisip-find.c
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c
index 2f8d80f..cba8a7a 100644
--- a/src/ipaccess/abisip-find.c
+++ b/src/ipaccess/abisip-find.c
@@ -1,6 +1,7 @@
 /* ip.access nanoBTS configuration tool */
 
 /* (C) 2009-2010 by Harald Welte 
+ * (C) 2017 by sysmocom - s.f.m.c. GmbH 
  * All Rights Reserved
  *
  * This program is free software; you can redistribute it and/or modify
@@ -355,7 +356,8 @@
struct osmo_fd bfd;
int rc;
 
-   printf("abisip-find (C) 2009 by Harald Welte\n");
+   printf("abisip-find (C) 2009-2010 by Harald Welte\n");
+   printf("(C) 2017 by sysmocom - s.f.m.c. GmbH\n");
printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n");
 
handle_options(argc, argv);

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

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


[PATCH] osmo-bsc[master]: abisip-find: add getopt option parsing in preparation for a ...

2017-12-25 Thread Neels Hofmeyr

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

abisip-find: add getopt option parsing in preparation for a new option

Subsequent patch I4201876431029b303dbd10e46492228379c9782a will add the -l
cmdline option. Add getopt in a separate step here to keep the patch lean.

Change-Id: Idba1a89753510fe6d409277b20c2db86c1b8f7f8
---
M src/ipaccess/abisip-find.c
1 file changed, 55 insertions(+), 7 deletions(-)


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

diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c
index c459161..46205dd 100644
--- a/src/ipaccess/abisip-find.c
+++ b/src/ipaccess/abisip-find.c
@@ -24,13 +24,63 @@
 #include 
 #include 
 #include 
-
+#include 
 
 #include 
 #include 
 #include 
 #include 
 #include 
+
+static struct {
+   const char *ifname;
+} cmdline_opts = {
+   .ifname = NULL,
+};
+
+static void print_help()
+{
+   printf("\n");
+   printf("Usage: abisip-find [-l] []\n");
+   printf("Specify the outgoing network interface,\n"
+  "e.g. 'eth0'\n");
+}
+
+static void handle_options(int argc, char **argv)
+{
+   while (1) {
+   int option_index = 0, c;
+   static struct option long_options[] = {
+   {"help", 0, 0, 'h'},
+   {0, 0, 0, 0}
+   };
+
+   c = getopt_long(argc, argv, "h",
+   long_options, _index);
+   if (c == -1)
+   break;
+
+   switch (c) {
+   case 'h':
+   print_help();
+   exit(EXIT_SUCCESS);
+   default:
+   /* catch unknown options *as well as* missing 
arguments. */
+   fprintf(stderr, "Error in command line options. 
Exiting. Try --help.\n");
+   exit(EXIT_FAILURE);
+   break;
+   }
+   }
+
+   if (argc - optind > 0)
+   cmdline_opts.ifname = argv[optind++];
+
+   if (argc - optind > 0) {
+   fprintf(stderr, "Error: too many arguments\n");
+   print_help();
+   exit(EXIT_FAILURE);
+   }
+}
 
 static int udp_sock(const char *ifname)
 {
@@ -173,22 +223,20 @@
 int main(int argc, char **argv)
 {
struct osmo_fd bfd;
-   char *ifname = NULL;
int rc;
 
printf("abisip-find (C) 2009 by Harald Welte\n");
printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n");
 
-   if (argc < 2) {
+   handle_options(argc, argv);
+
+   if (!cmdline_opts.ifname)
fprintf(stdout, "you might need to specify the outgoing\n"
" network interface, e.g. ``%s eth0''\n", argv[0]);
-   } else {
-   ifname = argv[1];
-   }
 
bfd.cb = bfd_cb;
bfd.when = BSC_FD_READ | BSC_FD_WRITE;
-   bfd.fd = udp_sock(ifname);
+   bfd.fd = udp_sock(cmdline_opts.ifname);
if (bfd.fd < 0) {
perror("Cannot create local socket for broadcast udp");
exit(1);

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

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


[PATCH] osmo-bsc[master]: abisip-find: add -l to list base stations instead of streami...

2017-12-25 Thread Neels Hofmeyr

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

abisip-find: add -l to list base stations instead of streaming replies

To get an overview of what base stations are present in a network, particularly
with many base stations being present, it is particularly useful to get a list
of connected base stations instead of just output of received replies.

Keep a sorted list of known base stations, which time out after 10 seconds.
Print additions and removals, and total amount of replies received. On each
change, print the entire list.

Output a running total of replies received, to provide comfort to the reader
that something is still happening, and to confirm that the shown listing is
still up-to-date (updated on the same line by means of '\r').

It looks like:

  - Mon Dec 25 18:59:43 2017

0: MAC_Address='00:02:95:07:dc:bd'  IP_Address='192.168.0.124'  
Unit_ID='1/1/1'  Location_1='Unknown'  Location_2='3GAP'  
Equipment_Version='237B015_C'  Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-152614'
1: MAC_Address='00:02:95:07:dd:57'  IP_Address='192.168.0.15'  
Unit_ID='1/1/1'  Location_1='Unknown'  Location_2='3GAP'  
Equipment_Version='237B015_C'  Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-154153'

  Total: 2
  RX: 11

  - Mon Dec 25 19:00:12 2017

  LOST:
  MAC_Address='00:02:95:07:dd:57'  IP_Address='192.168.0.15'  Unit_ID='1/1/1'  
Location_1='Unknown'  Location_2='3GAP'  Equipment_Version='237B015_C'  
Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-154153'

  - Mon Dec 25 19:00:12 2017

0: MAC_Address='00:02:95:07:dc:bd'  IP_Address='192.168.0.124'  
Unit_ID='1/1/1'  Location_1='Unknown'  Location_2='3GAP'  
Equipment_Version='237B015_C'  Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-152614'

  Total: 1
  RX: 15

  - Mon Dec 25 19:00:28 2017

  New:
  MAC_Address='00:02:95:07:dd:57'  IP_Address='192.168.0.15'  Unit_ID='1/1/1'  
Location_1='Unknown'  Location_2='3GAP'  Equipment_Version='237B015_C'  
Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-154153'

  - Mon Dec 25 19:00:28 2017

0: MAC_Address='00:02:95:07:dc:bd'  IP_Address='192.168.0.124'  
Unit_ID='1/1/1'  Location_1='Unknown'  Location_2='3GAP'  
Equipment_Version='237B015_C'  Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-152614'
1: MAC_Address='00:02:95:07:dd:57'  IP_Address='192.168.0.15'  
Unit_ID='1/1/1'  Location_1='Unknown'  Location_2='3GAP'  
Equipment_Version='237B015_C'  Software_Version='unknown'  Unit_Name='Unknown'  
Serial_Number='000295-154153'
  RX: 18

Change-Id: I4201876431029b303dbd10e46492228379c9782a
---
M src/ipaccess/abisip-find.c
1 file changed, 140 insertions(+), 8 deletions(-)


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

diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c
index 46205dd..2f8d80f 100644
--- a/src/ipaccess/abisip-find.c
+++ b/src/ipaccess/abisip-find.c
@@ -25,17 +25,22 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 static struct {
const char *ifname;
+   bool list_view;
 } cmdline_opts = {
.ifname = NULL,
+   .list_view = false,
 };
 
 static void print_help()
@@ -44,6 +49,9 @@
printf("Usage: abisip-find [-l] []\n");
printf("Specify the outgoing network interface,\n"
   "e.g. 'eth0'\n");
+   printf("  -l --list-viewInstead of printing received responses,\n"
+  "output a sorted list of currently present\n"
+  "base stations and change events.\n");
 }
 
 static void handle_options(int argc, char **argv)
@@ -52,10 +60,11 @@
int option_index = 0, c;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
+   {"list-view", 0, 0, 'l'},
{0, 0, 0, 0}
};
 
-   c = getopt_long(argc, argv, "h",
+   c = getopt_long(argc, argv, "hl",
long_options, _index);
if (c == -1)
break;
@@ -64,6 +73,9 @@
case 'h':
print_help();
exit(EXIT_SUCCESS);
+   case 'l':
+   cmdline_opts.list_view = true;
+   break;
default:
/* catch unknown options *as well as* missing 
arguments. */
fprintf(stderr, "Error in command line options. 
Exiting. Try --help.\n");
@@ -159,22 +171,137 @@
return sendto(fd, find_pkt, sizeof(find_pkt), 0, (struct sockaddr *) 
, sizeof(sa));
 }
 
-static int parse_response(unsigned char *buf, int len)
+static char 

[PATCH] osmo-iuh[master]: vty typo: 'show hnb': SCTP stream, not SCCP stream

2017-12-25 Thread Neels Hofmeyr

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

vty typo: 'show hnb': SCTP stream, not SCCP stream

Change-Id: Iceb29af9f4ef6b4b4ed9778bdd683d30c201371d
---
M src/hnbgw_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/85/5585/1

diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index d41e3c0..060319b 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -181,7 +181,7 @@
vty_out(vty, "HNB ");
vty_out_ofd_addr(vty, hnb->conn? osmo_stream_srv_get_ofd(hnb->conn) : 
NULL);
vty_out(vty, " \"%s\"%s", hnb->identity_info, VTY_NEWLINE);
-   vty_out(vty, "MCC %u MNC %u LAC %u RAC %u SAC %u CID %u 
SCCP-stream:HNBAP=%u,RUA=%u%s",
+   vty_out(vty, "MCC %u MNC %u LAC %u RAC %u SAC %u CID %u 
SCTP-stream:HNBAP=%u,RUA=%u%s",
hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, 
hnb->id.sac, hnb->id.cid,
hnb->hnbap_stream, hnb->rua_stream, VTY_NEWLINE);
 

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

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


python/osmo-python-tests[master]: Improve python3 compatibility

2017-12-25 Thread Neels Hofmeyr

Patch Set 6: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121
Gerrit-PatchSet: 6
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


python/osmo-python-tests[master]: Improve python3 compatibility

2017-12-25 Thread Neels Hofmeyr

Patch Set 6:

> > why you want to make the py2 scripts py3 compatible
 > 
 > Because it's 1) easy, 2) testable 3) makes them future proof when
 > python 2 is retired.

py2->3 migration is more than print(), there's at least the handling of 
character encoding which is quite different as well. So you won't know that the 
migration worked out until you've actually run it with py3 (with some odd 
characters involved). try:..except: statements are different. and so forth... 
so I'm still a bit sceptical on the whole idea, but if you say it works...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121
Gerrit-PatchSet: 6
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] osmo-iuh[master]: compiler warning: asn1tostruct.py: return 0 at end of *_free...

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: compiler warning: asn1tostruct.py: return 0 at end of *_free_*()
..


compiler warning: asn1tostruct.py: return 0 at end of *_free_*()

Part of the resulting diff in the generated code:

--- /tmp/hnbap_decoder.c2017-12-24 17:06:50.983979866 +0100
+++ /tmp/hnbap_decoder.c2017-12-24 17:07:10.760223354 +0100
@@ -1179,6 +1179,7 @@
 TNLUpdateResponseIEs_t *tnlUpdateResponseIEs) {

 ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Context_ID, 
>context_ID);
+return 0;
 }

 int hnbap_free_tnlupdaterequesties(
@@ -1187,6 +1188,7 @@
 ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Context_ID, 
>context_ID);
 ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RABList, 
>rabList);
 ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Update_cause, 
>update_cause);
+return 0;
 }

 int hnbap_free_errorindicationies(
@@ -1197,12 +1199,14 @@
 if ((errorIndicationIEs->presenceMask & 
ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT)
 == ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT)
 ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_CriticalityDiagnostics, 
>criticalityDiagnostics);
+return 0;
 }

 int hnbap_free_hnbconfigtransferrequesties(
 HNBConfigTransferRequestIEs_t *hnbConfigTransferRequestIEs) {

 ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NeighbourInfoRequestList, 
>neighbourInfoRequestList);
+return 0;
 }

 int hnbap_free_tnlupdatefailureies(

[etc.]

Related: OS#2670
Change-Id: Ieba12c09c33a81da964bf88a858714d922ced8c0
---
M asn1/utils/asn1tostruct.py
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/asn1/utils/asn1tostruct.py b/asn1/utils/asn1tostruct.py
index 5586e40..0bba9dd 100755
--- a/asn1/utils/asn1tostruct.py
+++ b/asn1/utils/asn1tostruct.py
@@ -389,6 +389,8 @@
 iename = re.sub('id-', '', ie[0])
 ienameunderscore = lowerFirstCamelWord(re.sub('-', '_', iename))
 f.write("ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_%s, &%s->%s);\n" % 
(ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), 
ienameunderscore))
+
+f.write("return 0;\n")
 f.write("}\n\n")
 
 for key in iesDefs:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieba12c09c33a81da964bf88a858714d922ced8c0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: segfault: context_map gc: use llist_for_each_entry_safe()

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: segfault: context_map gc: use llist_for_each_entry_safe()
..


segfault: context_map gc: use llist_for_each_entry_safe()

The context map garbage collector removes entries from the list, hence it must
use llist_for_each_entry_safe().

We haven't hit this before since nothing is yet flagging context maps to be
discarded.

Related: OS#2776
Change-Id: I9d5899923054d1bf862d542fec862fb1e6f07dce
---
M src/context_map.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/context_map.c b/src/context_map.c
index 0c891cf..dca276a 100644
--- a/src/context_map.c
+++ b/src/context_map.c
@@ -146,10 +146,10 @@
 {
struct hnb_gw *gw = data;
struct hnbgw_cnlink *cn = gw->sccp.cnlink;
-   struct hnbgw_context_map *map;
+   struct hnbgw_context_map *map, *next_map;
 
DEBUGP(DMAIN, "Running context mapper garbage collection\n");
-   llist_for_each_entry(map, >map_list, cn_list) {
+   llist_for_each_entry_safe(map, next_map, >map_list, cn_list) {
switch (map->state) {
case MAP_S_RESERVED1:
/* first time we see this reserved

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9d5899923054d1bf862d542fec862fb1e6f07dce
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: rua_to_scu(): don't create a context map for UNITDATA

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: rua_to_scu(): don't create a context map for UNITDATA
..


rua_to_scu(): don't create a context map for UNITDATA

UNITDATA is connection-less, and as can be observed further below, the 'map'
doesn't get used in the N_UNIDATA case.

Related: OS#2776
Change-Id: Ic35562e6d7bfa54b6be859860657f9a235ad5a50
---
M src/hnbgw_rua.c
1 file changed, 16 insertions(+), 8 deletions(-)

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



diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 1d0ffbd..58bb23b 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -213,13 +213,21 @@
prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim));
osmo_prim_init(>oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg);
 
-   map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);
-   OSMO_ASSERT(map);
-
-   DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n",
-  cn_domain_indicator_to_str(cN_DomainIndicator),
-  osmo_sccp_addr_dump(remote_addr),
-  map->rua_ctx_id, map->scu_conn_id);
+   switch (type) {
+   case OSMO_SCU_PRIM_N_UNITDATA:
+   DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, 
no scu_conn_id)\n",
+  cn_domain_indicator_to_str(cN_DomainIndicator),
+  osmo_sccp_addr_dump(remote_addr),
+  map->rua_ctx_id);
+   break;
+   default:
+   map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);
+   OSMO_ASSERT(map);
+   DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id 
%u\n",
+  cn_domain_indicator_to_str(cN_DomainIndicator),
+  osmo_sccp_addr_dump(remote_addr),
+  map->rua_ctx_id, map->scu_conn_id);
+   }
 
/* add primitive header */
switch (type) {
@@ -263,7 +271,7 @@
 
rc = osmo_sccp_user_sap_down(cn->sccp_user, >oph);
 
-   if (release_context_map)
+   if (map && release_context_map)
context_map_deactivate(map);
 
return rc;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic35562e6d7bfa54b6be859860657f9a235ad5a50
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: cosmetic: context_map_tmr_cb(): fix comment

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: cosmetic: context_map_tmr_cb(): fix comment
..


cosmetic: context_map_tmr_cb(): fix comment

Change-Id: I4dd07a4d09d3cd4dc2a08e42ee48344967e5e3a6
---
M src/context_map.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/context_map.c b/src/context_map.c
index dca276a..dc555bf 100644
--- a/src/context_map.c
+++ b/src/context_map.c
@@ -157,7 +157,7 @@
map->state = MAP_S_RESERVED2;
break;
case MAP_S_RESERVED2:
-   /* first time we see this reserved
+   /* second time we see this reserved
 * entry: remove it */
map->state = MAP_S_NULL;
llist_del(>cn_list);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4dd07a4d09d3cd4dc2a08e42ee48344967e5e3a6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: comments: hnbgw_rua.c: remove obsolete fixmes for asn1 free

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: comments: hnbgw_rua.c: remove obsolete fixmes for asn1 free
..


comments: hnbgw_rua.c: remove obsolete fixmes for asn1 free

The comments are all right above the line that does the proper asn1 free step.

Change-Id: I60e3be8c56ecc75c22e76f9e9dce8c72753e153b
---
M src/hnbgw_rua.c
1 file changed, 1 insertion(+), 3 deletions(-)

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



diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 58bb23b..b2b8792 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -361,7 +361,7 @@
rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT,
context_id, 0, ies.ranaP_Message.buf,
ies.ranaP_Message.size);
-   /* FIXME: what to do with the asn1c-allocated memory */
+
rua_free_connecties();
 
return rc;
@@ -396,7 +396,6 @@
OSMO_SCU_PRIM_N_DISCONNECT,
context_id, scu_cause, ranap_data, ranap_len);
 
-   /* FIXME: what to do with the asn1c-allocated memory */
rua_free_disconnecties();
 
return rc;
@@ -423,7 +422,6 @@
context_id, 0, ies.ranaP_Message.buf,
ies.ranaP_Message.size);
 
-   /* FIXME: what to do with the asn1c-allocated memory */
rua_free_directtransferies();
 
return rc;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I60e3be8c56ecc75c22e76f9e9dce8c72753e153b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: osmo-hnbgw config: add 'rnc-id' config item

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: osmo-hnbgw config: add 'rnc-id' config item
..


osmo-hnbgw config: add 'rnc-id' config item

So far, the RNC-Id is hard-coded as 23. Still use 23 as default, but allow
configuring by config file. Hence make it possible to run multiple osmo-hnbgw
with differing RNC-Id each.

Change-Id: I374f558cc4bb36055f39efe9c58ae1b9bd49da46
---
M src/hnbgw_vty.c
1 file changed, 13 insertions(+), 0 deletions(-)

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



diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 4e512e4..d41e3c0 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -239,6 +239,17 @@
return CMD_SUCCESS;
 }
 
+DEFUN(cfg_hnbgw_rnc_id, cfg_hnbgw_rnc_id_cmd,
+  "rnc-id <0-65535>",
+  "Configure the HNBGW's RNC Id, the common RNC Id used for all connected 
hNodeB. It is sent to"
+  " each hNodeB upon HNBAP HNB-Register-Accept, and the hNodeB will 
subsequently send this as"
+  " RANAP InitialUE Messages' GlobalRNC-ID IE. Takes effect as soon as the 
hNodeB re-registers.\n"
+  "RNC Id value\n")
+{
+   g_hnb_gw->config.rnc_id = atoi(argv[0]);
+   return CMD_SUCCESS;
+}
+
 DEFUN(cfg_hnbgw_iuh_local_ip, cfg_hnbgw_iuh_local_ip_cmd, "local-ip A.B.C.D",
   "Accept Iuh connections on local interface\n"
   "Local interface IP address (default: " HNBGW_LOCAL_IP_DEFAULT ")")
@@ -345,6 +356,8 @@
install_element(CONFIG_NODE, _hnbgw_cmd);
install_node(_node, config_write_hnbgw);
 
+   install_element(HNBGW_NODE, _hnbgw_rnc_id_cmd);
+
install_element(HNBGW_NODE, _hnbgw_iuh_cmd);
install_node(_node, config_write_hnbgw_iuh);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I374f558cc4bb36055f39efe9c58ae1b9bd49da46
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: rua: discard context maps on id-Disconnect

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: rua: discard context maps on id-Disconnect
..


rua: discard context maps on id-Disconnect

When an id-Disconnect is received, the RUA to SCCP user context becomes unused.
Mark the context map as inactive in that case. It will be cleaned up by the
context map garbage collector.

Related: OS#2776
Change-Id: I9616f72bfa566de081098ee13e720ff0f5266c77
---
M src/hnbgw_rua.c
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 305b8cc..1d0ffbd 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -185,6 +185,7 @@
struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink;
struct osmo_sccp_addr *remote_addr;
bool is_ps;
+   bool release_context_map = false;
int rc;
 
switch (cN_DomainIndicator) {
@@ -239,6 +240,7 @@
case OSMO_SCU_PRIM_N_DISCONNECT:
prim->u.disconnect.conn_id = map->scu_conn_id;
prim->u.disconnect.cause = cause;
+   release_context_map = true;
break;
case OSMO_SCU_PRIM_N_UNITDATA:
prim->u.unitdata.called_addr = *remote_addr;
@@ -261,6 +263,9 @@
 
rc = osmo_sccp_user_sap_down(cn->sccp_user, >oph);
 
+   if (release_context_map)
+   context_map_deactivate(map);
+
return rc;
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9616f72bfa566de081098ee13e720ff0f5266c77
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: vty: tweak / improve HNB and cnlink introspection

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty: tweak / improve HNB and cnlink introspection
..


vty: tweak / improve HNB and cnlink introspection

Add 'show cnlink' (uses new osmo_sccp_user_name(), see 'Depends' below).

Tweak 'show hnb all'.

The result looks something like:

  OsmoHNBGW> show cnlink
  IuCS: OsmoHNBGW:RI=SSN_PC,PC=0.23.5,SSN=RANAP <-> 
RI=SSN_PC,PC=0.23.1,SSN=RANAP
SS7 route: pc=0=0.0.0 mask=0x0=0.0.0 via AS as-clnt-OsmoHNBGW 
proto=m3ua ASP asp-clnt-OsmoHNBGW (r=127.0.0.1:2905<->l=127.0.0.1:37699)
  IuPS: OsmoHNBGW:RI=SSN_PC,PC=0.23.5,SSN=RANAP <-> 
RI=SSN_PC,PC=0.23.4,SSN=RANAP
SS7 route: pc=0=0.0.0 mask=0x0=0.0.0 via AS as-clnt-OsmoHNBGW 
proto=m3ua ASP asp-clnt-OsmoHNBGW (r=127.0.0.1:2905<->l=127.0.0.1:37699)

  OsmoHNBGW> show hnb all
  No HNB connected

  OsmoHNBGW> show hnb all
  HNB (r=192.168.0.124:29169<->l=192.168.0.9:29169) 
"000295-152...@ap.ipaccess.com"
  MCC 901 MNC 70 LAC 14357 RAC 11 SAC 1 CID 8595638 
SCCP-stream:HNBAP=0,RUA=0
  IuCS 24->1002 (RUA->SUA) state=1
  IuPS 24->1003 (RUA->SUA) state=1
  HNB (r=192.168.0.15:29169<->l=192.168.0.9:29169) 
"000295-154...@ap.ipaccess.com"
  MCC 901 MNC 70 LAC 24358 RAC 22 SAC 65535 CID 1048575 
SCCP-stream:HNBAP=0,RUA=0
  IuCS 23->1000 (RUA->SUA) state=1
  IuPS 23->1001 (RUA->SUA) state=1
  2 HNB connected

Related: OS#2772 OS#2773
Depends: Ib7abf69cfcf4c56273223054b280458451e6c2f6 (libosmo-sccp)
 Ia0d15a2814b08bc3f052a1ed12dbb68bade55309 (libosmo-sccp)
Change-Id: I3c937306a011715e163a40bc8ef8ec7e8d4e5d08
---
M src/hnbgw_vty.c
1 file changed, 65 insertions(+), 7 deletions(-)

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



diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 3d16970..d50c4a5 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -20,6 +20,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -27,6 +28,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 static void *tall_hnb_ctx = NULL;
 static struct hnb_gw *g_hnb_gw = NULL;
@@ -108,19 +111,68 @@
return vty->node;
 }
 
+DEFUN(show_cnlink, show_cnlink_cmd, "show cnlink",
+  SHOW_STR "Display information on core network link\n")
+{
+   struct osmo_ss7_route *rt;
+   struct osmo_ss7_instance *ss7 = 
osmo_sccp_get_ss7(g_hnb_gw->sccp.client);
+   int i;
+#define GUARD(STR) \
+   STR ? STR : "", \
+   STR ? ":" : ""
+   
+   vty_out(vty, "IuCS: %s <->",
+   osmo_sccp_user_name(g_hnb_gw->sccp.cnlink->sccp_user));
+   vty_out(vty, " %s%s%s%s",
+   GUARD(g_hnb_gw->config.iucs_remote_addr_name),
+   osmo_sccp_inst_addr_name(g_hnb_gw->sccp.client, 
_hnb_gw->sccp.iucs_remote_addr),
+   VTY_NEWLINE);
+
+   rt = osmo_ss7_route_lookup(ss7, g_hnb_gw->sccp.iucs_remote_addr.pc);
+   vty_out(vty, "  SS7 route: %s%s", osmo_ss7_route_name(rt, true), 
VTY_NEWLINE);
+
+   vty_out(vty, "IuPS: %s <->",
+   osmo_sccp_user_name(g_hnb_gw->sccp.cnlink->sccp_user));
+   vty_out(vty, " %s%s%s%s",
+   GUARD(g_hnb_gw->config.iups_remote_addr_name),
+   osmo_sccp_inst_addr_name(g_hnb_gw->sccp.client, 
_hnb_gw->sccp.iups_remote_addr),
+   VTY_NEWLINE);
+
+   rt = osmo_ss7_route_lookup(ss7, g_hnb_gw->sccp.iups_remote_addr.pc);
+   vty_out(vty, "  SS7 route: %s%s", osmo_ss7_route_name(rt, true), 
VTY_NEWLINE);
+
+#undef GUARD
+   return CMD_SUCCESS;
+}
+
+static void vty_out_ofd_addr(struct vty *vty, struct osmo_fd *ofd)
+{
+char *name;
+if (!ofd || ofd->fd < 0
+   || !(name = osmo_sock_get_name(vty, ofd->fd))) {
+   vty_out(vty, "(no addr)");
+   return;
+}
+vty_out(vty, name);
+talloc_free(name);
+}
+
 static void vty_dump_hnb_info(struct vty *vty, struct hnb_context *hnb)
 {
struct hnbgw_context_map *map;
 
-   vty_out(vty, "HNB \"%s\" MCC %u MNC %u LAC %u RAC %u SAC %u CID %u%s", 
hnb->identity_info,
-   hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, 
hnb->id.sac, hnb->id.cid,
-   VTY_NEWLINE);
-   vty_out(vty, "   HNBAP ID %u RUA ID %u%s", hnb->hnbap_stream, 
hnb->rua_stream, VTY_NEWLINE);
+   vty_out(vty, "HNB ");
+   vty_out_ofd_addr(vty, hnb->conn? osmo_stream_srv_get_ofd(hnb->conn) : 
NULL);
+   vty_out(vty, " \"%s\"%s", hnb->identity_info, VTY_NEWLINE);
+   vty_out(vty, "MCC %u MNC %u LAC %u RAC %u SAC %u CID %u 
SCCP-stream:HNBAP=%u,RUA=%u%s",
+   hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, 
hnb->id.sac, hnb->id.cid,
+   hnb->hnbap_stream, hnb->rua_stream, VTY_NEWLINE);
 
llist_for_each_entry(map, >map_list, hnb_list) {
-   vty_out(vty, " Map %u->%u (RUA->SUA) cnlink=%p state=%u%s", 
map->rua_ctx_id, map->scu_conn_id,
-  

[MERGED] osmo-iuh[master]: osmo-hnbgw: startup: log the RNC-Id that is going to be used

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: osmo-hnbgw: startup: log the RNC-Id that is going to be used
..


osmo-hnbgw: startup: log the RNC-Id that is going to be used

Change-Id: I8aeb93fe8037e5fdc0784f5fc3bdb527de3b76bd
---
M src/hnbgw.c
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/src/hnbgw.c b/src/hnbgw.c
index ff3e2a9..752fc0f 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -485,6 +485,8 @@
exit(1);
}
 
+   LOGP(DHNBAP, LOGL_NOTICE, "Using RNC-Id %u\n", g_hnb_gw->config.rnc_id);
+
OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip);
LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n",
 g_hnb_gw->config.iuh_local_ip,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8aeb93fe8037e5fdc0784f5fc3bdb527de3b76bd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: osmo-hnbgw: vty: revamp output of context maps on 'show hnb'

2017-12-25 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: osmo-hnbgw: vty: revamp output of context maps on 'show hnb'
..


osmo-hnbgw: vty: revamp output of context maps on 'show hnb'

Instead of listing each and every context map, rather output a summary of
context counts.

Rationale: in a list of a hundred HNBs, I don't want to also see a dozen (or
potentially thousands of) context map lines for each. Furthermore, the conn IDs
aren't necessarily useful on network traces either.

For example, what was shown as SUA Id is incidentally the SCCP Reference, but
this is not a hard requirement and may change. Also, the reference is shown in
wireshark as a hex in mismatching byte order ... so rather don't bother.

The result now looks like

  OsmoHNBGW> show hnb all
  HNB (r=192.168.0.124:29169<->l=192.168.0.9:29169) 
"000295-152...@ap.ipaccess.com"
  MCC 901 MNC 70 LAC 14357 RAC 11 SAC 1 CID 8595638 
SCCP-stream:HNBAP=0,RUA=0
  IuCS: 1 contexts: inactive-reserved:1
  IuPS: 1 contexts: active:1
  1 HNB connected

Related: OS#2772 OS#2773
Change-Id: Iae76b68e85863c8663bb5c508b85534c00e1d2c9
---
M include/osmocom/iuh/context_map.h
M src/context_map.c
M src/hnbgw_vty.c
3 files changed, 40 insertions(+), 4 deletions(-)

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



diff --git a/include/osmocom/iuh/context_map.h 
b/include/osmocom/iuh/context_map.h
index 8d957d6..6279b91 100644
--- a/include/osmocom/iuh/context_map.h
+++ b/include/osmocom/iuh/context_map.h
@@ -8,8 +8,13 @@
MAP_S_ACTIVE,   /* currently active map */
MAP_S_RESERVED1,/* just disconnected, still resrved */
MAP_S_RESERVED2,/* still reserved */
+   MAP_S_NUM_STATES/* Number of states, keep this at the end */
 };
 
+extern const struct value_string hnbgw_context_map_state_names[];
+static inline const char *hnbgw_context_map_state_name(enum 
hnbgw_context_map_state val)
+{ return get_value_string(hnbgw_context_map_state_names, val); }
+
 struct hnb_context;
 struct hnbgw_cnlink;
 
diff --git a/src/context_map.c b/src/context_map.c
index b90f555..0c891cf 100644
--- a/src/context_map.c
+++ b/src/context_map.c
@@ -27,6 +27,14 @@
 #include 
 #include 
 
+const struct value_string hnbgw_context_map_state_names[] = {
+   {MAP_S_NULL , "not-initialized"},
+   {MAP_S_ACTIVE   , "active"},
+   {MAP_S_RESERVED1, "inactive-reserved"},
+   {MAP_S_RESERVED2, "inactive-discard"},
+   {0, NULL}
+};
+
 /* is a given SCCP USER SAP Connection ID in use for a given CN link? */
 static int cn_id_in_use(struct hnbgw_cnlink *cn, uint32_t id)
 {
diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index d50c4a5..4e512e4 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -157,9 +157,26 @@
 talloc_free(name);
 }
 
+static void vty_dump_hnb_info__map_states(struct vty *vty, const char *name, 
unsigned int count,
+ unsigned int state_count[])
+{
+   unsigned int i;
+   if (!count)
+   return;
+   vty_out(vty, "%s: %u contexts:", name, count);
+   for (i = 0; i <= MAP_S_NUM_STATES; i++) {
+   if (!state_count[i])
+   continue;
+   vty_out(vty, " %s:%u", hnbgw_context_map_state_name(i), 
state_count[i]);
+   }
+   vty_out(vty, VTY_NEWLINE);
+}
+
 static void vty_dump_hnb_info(struct vty *vty, struct hnb_context *hnb)
 {
struct hnbgw_context_map *map;
+   unsigned int map_count[2] = {};
+   unsigned int state_count[2][MAP_S_NUM_STATES + 1] = {};
 
vty_out(vty, "HNB ");
vty_out_ofd_addr(vty, hnb->conn? osmo_stream_srv_get_ofd(hnb->conn) : 
NULL);
@@ -169,11 +186,13 @@
hnb->hnbap_stream, hnb->rua_stream, VTY_NEWLINE);
 
llist_for_each_entry(map, >map_list, hnb_list) {
-   vty_out(vty, "%s %u->%u (RUA->SUA) state=%u%s",
-   map->is_ps ? "IuPS" : "IuCS",
-   map->rua_ctx_id, map->scu_conn_id,
-   map->state, VTY_NEWLINE);
+   map_count[map->is_ps? 1 : 0]++;
+   state_count[map->is_ps? 1 : 0]
+  [(map->state >= 0 && map->state < MAP_S_NUM_STATES)?
+   map->state : MAP_S_NUM_STATES]++;
}
+   vty_dump_hnb_info__map_states(vty, "IuCS", map_count[0], 
state_count[0]);
+   vty_dump_hnb_info__map_states(vty, "IuPS", map_count[1], 
state_count[1]);
 }
 
 static void vty_dump_ue_info(struct vty *vty, struct ue_context *ue)
@@ -184,6 +203,7 @@
 DEFUN(show_hnb, show_hnb_cmd, "show hnb all", SHOW_STR "Display information 
about a HNB")
 {
struct hnb_context *hnb;
+   unsigned int count = 0;
 
if (llist_empty(_hnb_gw->hnb_list)) {
vty_out(vty, "No HNB connected%s", VTY_NEWLINE);
@@ -192,8 +212,11 @@
 
   

[MERGED] osmo-mgw[master]: libosmo-mgcp: Cosmetic spelling fixes in comments

2017-12-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libosmo-mgcp: Cosmetic spelling fixes in comments
..


libosmo-mgcp: Cosmetic spelling fixes in comments

Change-Id: Ic0469c2a4d69b55a6a90653ad7ea1ad89a34e4bc
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_protocol.c
6 files changed, 17 insertions(+), 17 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index c7634fb..d6397d3 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -105,12 +105,12 @@
 };
 
 /* There are up to three modes in which the keep-alive dummy packet can be
- * sent. The beviour is controlled viw the keepalive_interval member of the
+ * sent. The behaviour is controlled via the keepalive_interval member of the
  * trunk config. If that member is set to 0 (MGCP_KEEPALIVE_NEVER) no dummy-
  * packet is sent at all and the timer that sends regular dummy packets
  * is no longer scheduled. If the keepalive_interval is set to -1, only
  * one dummy packet is sent when an CRCX or an MDCX is performed. No timer
- * is scheduled. For all vales greater 0, the a timer is scheduled and the
+ * is scheduled. For all vales greater 0, the timer is scheduled and the
  * value is used as interval. See also mgcp_keepalive_timer_cb(),
  * handle_modify_con(), and handle_create_con() */
 #define MGCP_KEEPALIVE_ONCE (-1)
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 11bafe7..61d45bf 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -217,7 +217,7 @@
/*!< copy of the mode to restore the original setting (VTY) */
enum mgcp_connection_mode mode_orig;
 
-   /*!< connection id to identify the conntion */
+   /*!< connection id to identify the connection */
char id[MGCP_CONN_ID_LENGTH];
 
/*!< human readable name (vty, logging) */
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 9063bec..a136fda 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -249,9 +249,9 @@
return;
 }
 
-/*! dump basic connection information to human readble string.
+/*! dump basic connection information to human readable string.
  *  \param[in] conn to dump
- *  \returns human readble string */
+ *  \returns human readable string */
 char *mgcp_conn_dump(struct mgcp_conn *conn)
 {
static char str[sizeof(conn->name)+sizeof(conn->id)+256];
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index dc5628a..ac7dc67 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -372,8 +372,8 @@
 
/* Check we really managed to compensate the timestamp
 * offset. There should not be any remaining error, failing
-* here would point to a serous problem with the alingnment
-* error computation fuction */
+* here would point to a serous problem with the alignment
+* error computation function */
ts_check = ts_alignment_error(>out_stream, ptime,
  timestamp + 
state->patch.timestamp_offset);
OSMO_ASSERT(ts_check == 0);
@@ -387,7 +387,7 @@
  *  \param[in] destination RTP end
  *  \param[in,out] pointer to buffer with voice data
  *  \param[in] voice data length
- *  \param[in] maxmimum size of caller provided voice data buffer
+ *  \param[in] maximum size of caller provided voice data buffer
  *  \returns ignores input parameters, return always 0 */
 int mgcp_rtp_processing_default(struct mgcp_endpoint *endp,
struct mgcp_rtp_end *dst_end,
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 6e19611..d0141f3 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -142,7 +142,7 @@
 }
 
 /* Lookup existing handle for a specified address, if the handle can not be
- * foud a the function will automatically allocate one */
+ * found, the function will automatically allocate one */
 static struct osmux_in_handle *
 osmux_handle_lookup(struct mgcp_config *cfg, struct in_addr *addr, int 
rem_port)
 {
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index a1ecce2..f87f341 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -317,10 +317,10 @@
return create_ok_response(p->endp, 200, "AUEP", p->trans);
 }
 
-/* Try to find a free port by attemting to bind on it. Also handle the
+/* Try to find a free port by attempting to bind on it. Also handle the
  * counter that points on the next free port. Since we have a 

[MERGED] osmo-mgw[master]: strct mgcp_rtp_state: Group + document struct members relate...

2017-12-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: strct mgcp_rtp_state: Group + document struct members related 
to patching
..


strct mgcp_rtp_state: Group + document struct members related to patching

Change-Id: I403ddcafe0a11290103bb017568cfacaf5c04412
---
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_network.c
2 files changed, 31 insertions(+), 24 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index c3f9ba1..8d82b14 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -50,14 +50,21 @@
 };
 
 struct mgcp_rtp_state {
+   /* has this state structure been initialized? */
int initialized;
-   int patch_ssrc;
 
-   uint32_t orig_ssrc;
+   struct {
+   /* are we patching the SSRC value? */
+   int patch_ssrc;
+   /* original SSRC (to which we shall patch any different SSRC) */
+   uint32_t orig_ssrc;
+   /* offset to apply on the sequence number */
+   int seq_offset;
+   /* offset to apply on the timestamp number */
+   int32_t timestamp_offset;
+   } patch;
 
-   int seq_offset;
-
-   int32_t  timestamp_offset;
+   /* duration of a packet (FIXME: in which unit?) */
uint32_t packet_duration;
 
struct mgcp_rtp_stream_state in_stream;
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index aac3e51..8c0a7e3 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -231,7 +231,7 @@
 "on 0x%x SSRC: %u timestamp: %u "
 "from %s:%d\n",
 text, seq,
-state->timestamp_offset, state->seq_offset,
+state->patch.timestamp_offset, 
state->patch.seq_offset,
 ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp,
 inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
}
@@ -325,15 +325,15 @@
out_timestamp = state->out_stream.last_timestamp + delta_seq * tsdelta;
timestamp_offset = out_timestamp - in_timestamp;
 
-   if (state->timestamp_offset != timestamp_offset) {
-   state->timestamp_offset = timestamp_offset;
+   if (state->patch.timestamp_offset != timestamp_offset) {
+   state->patch.timestamp_offset = timestamp_offset;
 
LOGP(DRTP, LOGL_NOTICE,
 "Timestamp offset change on 0x%x SSRC: %u "
 "SeqNo delta: %d, TS offset: %d, "
 "from %s:%d\n",
 ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
-delta_seq, state->timestamp_offset,
+delta_seq, state->patch.timestamp_offset,
 inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
}
 
@@ -354,11 +354,11 @@
/* Align according to: T + Toffs - Tlast = k * Tptime */
 
ts_error = ts_alignment_error(>out_stream, ptime,
- timestamp + state->timestamp_offset);
+ timestamp + 
state->patch.timestamp_offset);
 
/* If there is an alignment error, we have to compensate it */
if (ts_error) {
-   state->timestamp_offset += ptime - ts_error;
+   state->patch.timestamp_offset += ptime - ts_error;
 
LOGP(DRTP, LOGL_NOTICE,
 "Corrected timestamp alignment error of %d on 0x%x SSRC: 
%u "
@@ -366,7 +366,7 @@
 "from %s:%d\n",
 ts_error,
 ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
-state->timestamp_offset, inet_ntoa(addr->sin_addr),
+state->patch.timestamp_offset, inet_ntoa(addr->sin_addr),
 ntohs(addr->sin_port));
}
 
@@ -375,7 +375,7 @@
 * here would point to a serous problem with the alingnment
 * error computation fuction */
ts_check = ts_alignment_error(>out_stream, ptime,
- timestamp + state->timestamp_offset);
+ timestamp + 
state->patch.timestamp_offset);
OSMO_ASSERT(ts_check == 0);
 
/* Return alignment error before compensation */
@@ -508,7 +508,7 @@
if (!state->initialized) {
state->initialized = 1;
state->in_stream.last_seq = seq - 1;
-   state->in_stream.ssrc = state->orig_ssrc = ssrc;
+   state->in_stream.ssrc = state->patch.orig_ssrc = ssrc;
state->in_stream.last_tsdelta = 0;

[MERGED] osmo-mgw[master]: mgcp_rtp_end: Group statistics members into 'stats' sub-struct

2017-12-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: mgcp_rtp_end: Group statistics members into 'stats' sub-struct
..


mgcp_rtp_end: Group statistics members into 'stats' sub-struct

Change-Id: I4e0ecdcd9a75fe08abc55b730780c01617f3d4af
---
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_stat.c
M src/libosmo-mgcp/mgcp_vty.c
M tests/mgcp/mgcp_test.c
7 files changed, 26 insertions(+), 28 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 9e7246e..11bafe7 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -97,11 +97,14 @@
 
 struct mgcp_rtp_end {
/* statistics */
-   unsigned int packets_rx;
-   unsigned int octets_rx;
-   unsigned int packets_tx;
-   unsigned int octets_tx;
-   unsigned int dropped_packets;
+   struct {
+   unsigned int packets_rx;
+   unsigned int octets_rx;
+   unsigned int packets_tx;
+   unsigned int octets_tx;
+   unsigned int dropped_packets;
+   } stats;
+
struct in_addr addr;
 
/* in network byte order */
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 4090a9f..9063bec 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -93,12 +93,7 @@
 
end->rtp.fd = -1;
end->rtcp.fd = -1;
-   end->local_port = 0;
-   end->packets_rx = 0;
-   end->octets_rx = 0;
-   end->packets_tx = 0;
-   end->octets_tx = 0;
-   end->dropped_packets = 0;
+   memset(>stats, 0, sizeof(end->stats));
end->rtp_port = end->rtcp_port = 0;
talloc_free(end->fmtp_extra);
end->fmtp_extra = NULL;
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 2056a8e..dc5628a 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -693,7 +693,7 @@
dest_name = conn_dst->conn->name;
 
if (!rtp_end->output_enabled) {
-   rtp_end->dropped_packets += 1;
+   rtp_end->stats.dropped_packets += 1;
LOGP(DRTP, LOGL_DEBUG,
 "endpoint:0x%x output disabled, drop to %s %s "
 "rtp_port:%u rtcp_port:%u\n",
@@ -748,8 +748,8 @@
if (len <= 0)
return len;
 
-   conn_dst->end.packets_tx += 1;
-   conn_dst->end.octets_tx += len;
+   conn_dst->end.stats.packets_tx += 1;
+   conn_dst->end.stats.octets_tx += len;
 
nbytes += len;
buflen = cont;
@@ -768,8 +768,8 @@
_end->addr,
rtp_end->rtcp_port, buf, len);
 
-   conn_dst->end.packets_tx += 1;
-   conn_dst->end.octets_tx += len;
+   conn_dst->end.stats.packets_tx += 1;
+   conn_dst->end.stats.octets_tx += len;
 
return len;
}
@@ -929,8 +929,8 @@
}
 
/* Increment RX statistics */
-   conn->end.packets_rx += 1;
-   conn->end.octets_rx += rc;
+   conn->end.stats.packets_rx += 1;
+   conn->end.stats.octets_rx += rc;
 
/* Forward a copy of the RTP data to a debug ip/port */
forward_data(fd->fd, >tap_in, buf, rc);
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 5030812..6e19611 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -255,8 +255,8 @@
.sin_port = conn_net->end.rtp_port,
};
 
-   conn_bts->end.octets_tx += msg->len;
-   conn_bts->end.packets_tx++;
+   conn_bts->end.stats.octets_tx += msg->len;
+   conn_bts->end.stats.packets_tx++;
 
/* Send RTP data to NET */
/* FIXME: Get rid of conn_bts and conn_net! */
@@ -282,8 +282,8 @@
.sin_port = conn_bts->end.rtp_port,
};
 
-   conn_net->end.octets_tx += msg->len;
-   conn_net->end.packets_tx++;
+   conn_net->end.stats.octets_tx += msg->len;
+   conn_net->end.stats.packets_tx++;
 
/* Send RTP data to BTS */
/* FIXME: Get rid of conn_bts and conn_net! */
diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c
index 54c4b66..88a2d69 100644
--- a/src/libosmo-mgcp/mgcp_stat.c
+++ b/src/libosmo-mgcp/mgcp_stat.c
@@ -43,8 +43,8 @@
 * Make sure the sign is correct and use the biggest
 * positive/negative number that fits.
 */
-   *loss = *expected - end->packets_rx;
-   if (*expected < end->packets_rx) {
+   

osmo-mgw[master]: libosmo-mgcp: Cosmetic spelling fixes in comments

2017-12-25 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-mgw[master]: mgcp_rtp_end: Group statistics members into 'stats' sub-struct

2017-12-25 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-mgw[master]: strct mgcp_rtp_state: Group + document struct members relate...

2017-12-25 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-mgw[master]: mgcp_rtp_state: grup 'stats' members into sub-structure

2017-12-25 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-mgw[master]: mgcp_rtp_state: grup 'stats' members into sub-structure

2017-12-25 Thread Harald Welte

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

mgcp_rtp_state: grup 'stats' members into sub-structure

Change-Id: I92a1bead01c6b85bf237b6edf64a1b76b9e97c78
---
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_stat.c
M tests/mgcp/mgcp_test.c
4 files changed, 48 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/82/5582/1

diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 8d82b14..9e7246e 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -71,13 +71,16 @@
struct mgcp_rtp_stream_state out_stream;
 
/* jitter and packet loss calculation */
-   int stats_initialized;
-   uint16_t stats_base_seq;
-   uint16_t stats_max_seq;
-   uint32_t stats_ssrc;
-   uint32_t stats_jitter;
-   int32_t stats_transit;
-   int stats_cycles;
+   struct {
+   int initialized;
+   uint16_t base_seq;
+   uint16_t max_seq;
+   uint32_t ssrc;
+   uint32_t jitter;
+   int32_t transit;
+   int cycles;
+   } stats;
+
bool patched_first_rtp_payload; /* FIXME: drop this, see OS#2459 */
 };
 
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 877ce98..4f88341 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -433,14 +433,14 @@
int32_t d;
 
/* initialize or re-initialize */
-   if (!state->stats_initialized || state->stats_ssrc != ssrc) {
-   state->stats_initialized = 1;
-   state->stats_base_seq = seq;
-   state->stats_max_seq = seq - 1;
-   state->stats_ssrc = ssrc;
-   state->stats_jitter = 0;
-   state->stats_transit = transit;
-   state->stats_cycles = 0;
+   if (!state->stats.initialized || state->stats.ssrc != ssrc) {
+   state->stats.initialized = 1;
+   state->stats.base_seq = seq;
+   state->stats.max_seq = seq - 1;
+   state->stats.ssrc = ssrc;
+   state->stats.jitter = 0;
+   state->stats.transit = transit;
+   state->stats.cycles = 0;
} else {
uint16_t udelta;
 
@@ -451,10 +451,10 @@
 * It can't wrap during the initialization so let's
 * skip it here. The Appendix A probably doesn't have
 * this issue because of the probation. */
-   udelta = seq - state->stats_max_seq;
+   udelta = seq - state->stats.max_seq;
if (udelta < RTP_MAX_DROPOUT) {
-   if (seq < state->stats_max_seq)
-   state->stats_cycles += RTP_SEQ_MOD;
+   if (seq < state->stats.max_seq)
+   state->stats.cycles += RTP_SEQ_MOD;
} else if (udelta <= RTP_SEQ_MOD - RTP_MAX_MISORDER) {
LOGP(DRTP, LOGL_NOTICE,
 "RTP seqno made a very large jump on 0x%x delta: 
%u\n",
@@ -466,12 +466,12 @@
 * taken closer to the read function. This was taken from the
 * Appendix A of RFC 3550. Timestamp and arrival_time have a 1/rate
 * resolution. */
-   d = transit - state->stats_transit;
-   state->stats_transit = transit;
+   d = transit - state->stats.transit;
+   state->stats.transit = transit;
if (d < 0)
d = -d;
-   state->stats_jitter += d - ((state->stats_jitter + 8) >> 4);
-   state->stats_max_seq = seq;
+   state->stats.jitter += d - ((state->stats.jitter + 8) >> 4);
+   state->stats.max_seq = seq;
 }
 
 /* The RFC 3550 Appendix A assumes there are multiple sources but
diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c
index b84f5f2..54c4b66 100644
--- a/src/libosmo-mgcp/mgcp_stat.c
+++ b/src/libosmo-mgcp/mgcp_stat.c
@@ -30,10 +30,10 @@
struct mgcp_rtp_end *end, uint32_t *expected,
int *loss)
 {
-   *expected = state->stats_cycles + state->stats_max_seq;
-   *expected = *expected - state->stats_base_seq + 1;
+   *expected = state->stats.cycles + state->stats.max_seq;
+   *expected = *expected - state->stats.base_seq + 1;
 
-   if (!state->stats_initialized) {
+   if (!state->stats.initialized) {
*expected = 0;
*loss = 0;
return;
@@ -56,9 +56,9 @@
 /* Helper function for mgcp_format_stats_rtp() to calculate jitter */
 uint32_t calc_jitter(struct mgcp_rtp_state *state)
 {
-   if (!state->stats_initialized)
+   if (!state->stats.initialized)
return 0;
-   return state->stats_jitter >> 4;
+   return state->stats.jitter >> 4;
 }
 
 /* Generate statistics for an RTP connection */
diff 

[PATCH] osmo-mgw[master]: libosmo-mgcp: Cosmetic spelling fixes in comments

2017-12-25 Thread Harald Welte

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

libosmo-mgcp: Cosmetic spelling fixes in comments

Change-Id: Ic0469c2a4d69b55a6a90653ad7ea1ad89a34e4bc
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_protocol.c
6 files changed, 17 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/84/5584/1

diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index c7634fb..d6397d3 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -105,12 +105,12 @@
 };
 
 /* There are up to three modes in which the keep-alive dummy packet can be
- * sent. The beviour is controlled viw the keepalive_interval member of the
+ * sent. The behaviour is controlled via the keepalive_interval member of the
  * trunk config. If that member is set to 0 (MGCP_KEEPALIVE_NEVER) no dummy-
  * packet is sent at all and the timer that sends regular dummy packets
  * is no longer scheduled. If the keepalive_interval is set to -1, only
  * one dummy packet is sent when an CRCX or an MDCX is performed. No timer
- * is scheduled. For all vales greater 0, the a timer is scheduled and the
+ * is scheduled. For all vales greater 0, the timer is scheduled and the
  * value is used as interval. See also mgcp_keepalive_timer_cb(),
  * handle_modify_con(), and handle_create_con() */
 #define MGCP_KEEPALIVE_ONCE (-1)
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 11bafe7..61d45bf 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -217,7 +217,7 @@
/*!< copy of the mode to restore the original setting (VTY) */
enum mgcp_connection_mode mode_orig;
 
-   /*!< connection id to identify the conntion */
+   /*!< connection id to identify the connection */
char id[MGCP_CONN_ID_LENGTH];
 
/*!< human readable name (vty, logging) */
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 9063bec..a136fda 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -249,9 +249,9 @@
return;
 }
 
-/*! dump basic connection information to human readble string.
+/*! dump basic connection information to human readable string.
  *  \param[in] conn to dump
- *  \returns human readble string */
+ *  \returns human readable string */
 char *mgcp_conn_dump(struct mgcp_conn *conn)
 {
static char str[sizeof(conn->name)+sizeof(conn->id)+256];
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 9bf6f85..bd6bec9 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -371,8 +371,8 @@
 
/* Check we really managed to compensate the timestamp
 * offset. There should not be any remaining error, failing
-* here would point to a serous problem with the alingnment
-* error computation fuction */
+* here would point to a serous problem with the alignment
+* error computation function */
ts_check = ts_alignment_error(>out_stream, ptime,
  timestamp + 
state->patch.timestamp_offset);
OSMO_ASSERT(ts_check == 0);
@@ -386,7 +386,7 @@
  *  \param[in] destination RTP end
  *  \param[in,out] pointer to buffer with voice data
  *  \param[in] voice data length
- *  \param[in] maxmimum size of caller provided voice data buffer
+ *  \param[in] maximum size of caller provided voice data buffer
  *  \returns ignores input parameters, return always 0 */
 int mgcp_rtp_processing_default(struct mgcp_endpoint *endp,
struct mgcp_rtp_end *dst_end,
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 6e19611..d0141f3 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -142,7 +142,7 @@
 }
 
 /* Lookup existing handle for a specified address, if the handle can not be
- * foud a the function will automatically allocate one */
+ * found, the function will automatically allocate one */
 static struct osmux_in_handle *
 osmux_handle_lookup(struct mgcp_config *cfg, struct in_addr *addr, int 
rem_port)
 {
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index a1ecce2..f87f341 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -317,10 +317,10 @@
return create_ok_response(p->endp, 200, "AUEP", p->trans);
 }
 
-/* Try to find a free port by attemting to bind on it. Also handle the
+/* Try to find a free port by attempting to bind on it. Also handle the
  * counter that points on the next free port. Since we have a pointer
- * to the next free port, binding should work on the first attemt,
- * neverless, try at least the next 200 ports before giving up */
+ * to the next free 

[PATCH] osmo-mgw[master]: mgcp_rtp_end: Group statistics members into 'stats' sub-struct

2017-12-25 Thread Harald Welte

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

mgcp_rtp_end: Group statistics members into 'stats' sub-struct

Change-Id: I4e0ecdcd9a75fe08abc55b730780c01617f3d4af
---
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_stat.c
M src/libosmo-mgcp/mgcp_vty.c
M tests/mgcp/mgcp_test.c
7 files changed, 26 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/83/5583/1

diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 9e7246e..11bafe7 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -97,11 +97,14 @@
 
 struct mgcp_rtp_end {
/* statistics */
-   unsigned int packets_rx;
-   unsigned int octets_rx;
-   unsigned int packets_tx;
-   unsigned int octets_tx;
-   unsigned int dropped_packets;
+   struct {
+   unsigned int packets_rx;
+   unsigned int octets_rx;
+   unsigned int packets_tx;
+   unsigned int octets_tx;
+   unsigned int dropped_packets;
+   } stats;
+
struct in_addr addr;
 
/* in network byte order */
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 4090a9f..9063bec 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -93,12 +93,7 @@
 
end->rtp.fd = -1;
end->rtcp.fd = -1;
-   end->local_port = 0;
-   end->packets_rx = 0;
-   end->octets_rx = 0;
-   end->packets_tx = 0;
-   end->octets_tx = 0;
-   end->dropped_packets = 0;
+   memset(>stats, 0, sizeof(end->stats));
end->rtp_port = end->rtcp_port = 0;
talloc_free(end->fmtp_extra);
end->fmtp_extra = NULL;
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 4f88341..9bf6f85 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -692,7 +692,7 @@
dest_name = conn_dst->conn->name;
 
if (!rtp_end->output_enabled) {
-   rtp_end->dropped_packets += 1;
+   rtp_end->stats.dropped_packets += 1;
LOGP(DRTP, LOGL_DEBUG,
 "endpoint:0x%x output disabled, drop to %s %s "
 "rtp_port:%u rtcp_port:%u\n",
@@ -747,8 +747,8 @@
if (len <= 0)
return len;
 
-   conn_dst->end.packets_tx += 1;
-   conn_dst->end.octets_tx += len;
+   conn_dst->end.stats.packets_tx += 1;
+   conn_dst->end.stats.octets_tx += len;
 
nbytes += len;
buflen = cont;
@@ -767,8 +767,8 @@
_end->addr,
rtp_end->rtcp_port, buf, len);
 
-   conn_dst->end.packets_tx += 1;
-   conn_dst->end.octets_tx += len;
+   conn_dst->end.stats.packets_tx += 1;
+   conn_dst->end.stats.octets_tx += len;
 
return len;
}
@@ -928,8 +928,8 @@
}
 
/* Increment RX statistics */
-   conn->end.packets_rx += 1;
-   conn->end.octets_rx += rc;
+   conn->end.stats.packets_rx += 1;
+   conn->end.stats.octets_rx += rc;
 
/* Forward a copy of the RTP data to a debug ip/port */
forward_data(fd->fd, >tap_in, buf, rc);
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 5030812..6e19611 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -255,8 +255,8 @@
.sin_port = conn_net->end.rtp_port,
};
 
-   conn_bts->end.octets_tx += msg->len;
-   conn_bts->end.packets_tx++;
+   conn_bts->end.stats.octets_tx += msg->len;
+   conn_bts->end.stats.packets_tx++;
 
/* Send RTP data to NET */
/* FIXME: Get rid of conn_bts and conn_net! */
@@ -282,8 +282,8 @@
.sin_port = conn_bts->end.rtp_port,
};
 
-   conn_net->end.octets_tx += msg->len;
-   conn_net->end.packets_tx++;
+   conn_net->end.stats.octets_tx += msg->len;
+   conn_net->end.stats.packets_tx++;
 
/* Send RTP data to BTS */
/* FIXME: Get rid of conn_bts and conn_net! */
diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c
index 54c4b66..88a2d69 100644
--- a/src/libosmo-mgcp/mgcp_stat.c
+++ b/src/libosmo-mgcp/mgcp_stat.c
@@ -43,8 +43,8 @@
 * Make sure the sign is correct and use the biggest
 * positive/negative number that fits.
 */
-   *loss = *expected - end->packets_rx;
-   if (*expected < end->packets_rx) {
+   *loss = *expected - end->stats.packets_rx;
+   if (*expected < end->stats.packets_rx) {
if (*loss > 0)
*loss = INT_MIN;
} 

[PATCH] osmo-mgw[master]: strct mgcp_rtp_state: Group + document struct members relate...

2017-12-25 Thread Harald Welte

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

strct mgcp_rtp_state: Group + document struct members related to patching

Change-Id: I403ddcafe0a11290103bb017568cfacaf5c04412
---
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_network.c
2 files changed, 31 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/5581/1

diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index c3f9ba1..8d82b14 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -50,14 +50,21 @@
 };
 
 struct mgcp_rtp_state {
+   /* has this state structure been initialized? */
int initialized;
-   int patch_ssrc;
 
-   uint32_t orig_ssrc;
+   struct {
+   /* are we patching the SSRC value? */
+   int patch_ssrc;
+   /* original SSRC (to which we shall patch any different SSRC) */
+   uint32_t orig_ssrc;
+   /* offset to apply on the sequence number */
+   int seq_offset;
+   /* offset to apply on the timestamp number */
+   int32_t timestamp_offset;
+   } patch;
 
-   int seq_offset;
-
-   int32_t  timestamp_offset;
+   /* duration of a packet (FIXME: in which unit?) */
uint32_t packet_duration;
 
struct mgcp_rtp_stream_state in_stream;
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index fc6a1c8..877ce98 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -230,7 +230,7 @@
 "on 0x%x SSRC: %u timestamp: %u "
 "from %s:%d\n",
 text, seq,
-state->timestamp_offset, state->seq_offset,
+state->patch.timestamp_offset, 
state->patch.seq_offset,
 ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp,
 inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
}
@@ -324,15 +324,15 @@
out_timestamp = state->out_stream.last_timestamp + delta_seq * tsdelta;
timestamp_offset = out_timestamp - in_timestamp;
 
-   if (state->timestamp_offset != timestamp_offset) {
-   state->timestamp_offset = timestamp_offset;
+   if (state->patch.timestamp_offset != timestamp_offset) {
+   state->patch.timestamp_offset = timestamp_offset;
 
LOGP(DRTP, LOGL_NOTICE,
 "Timestamp offset change on 0x%x SSRC: %u "
 "SeqNo delta: %d, TS offset: %d, "
 "from %s:%d\n",
 ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
-delta_seq, state->timestamp_offset,
+delta_seq, state->patch.timestamp_offset,
 inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
}
 
@@ -353,11 +353,11 @@
/* Align according to: T + Toffs - Tlast = k * Tptime */
 
ts_error = ts_alignment_error(>out_stream, ptime,
- timestamp + state->timestamp_offset);
+ timestamp + 
state->patch.timestamp_offset);
 
/* If there is an alignment error, we have to compensate it */
if (ts_error) {
-   state->timestamp_offset += ptime - ts_error;
+   state->patch.timestamp_offset += ptime - ts_error;
 
LOGP(DRTP, LOGL_NOTICE,
 "Corrected timestamp alignment error of %d on 0x%x SSRC: 
%u "
@@ -365,7 +365,7 @@
 "from %s:%d\n",
 ts_error,
 ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
-state->timestamp_offset, inet_ntoa(addr->sin_addr),
+state->patch.timestamp_offset, inet_ntoa(addr->sin_addr),
 ntohs(addr->sin_port));
}
 
@@ -374,7 +374,7 @@
 * here would point to a serous problem with the alingnment
 * error computation fuction */
ts_check = ts_alignment_error(>out_stream, ptime,
- timestamp + state->timestamp_offset);
+ timestamp + 
state->patch.timestamp_offset);
OSMO_ASSERT(ts_check == 0);
 
/* Return alignment error before compensation */
@@ -507,7 +507,7 @@
if (!state->initialized) {
state->initialized = 1;
state->in_stream.last_seq = seq - 1;
-   state->in_stream.ssrc = state->orig_ssrc = ssrc;
+   state->in_stream.ssrc = state->patch.orig_ssrc = ssrc;
state->in_stream.last_tsdelta = 0;
state->packet_duration =
mgcp_rtp_packet_duration(endp, rtp_end);
@@ -518,7 +518,7 @@
 "endpoint:0x%x initializing stream, SSRC: %u timestamp: %u 
"